package org.lq.shopping.entity;
import java.io.Serializable;
/**
 * 订单
 */
import java.sql.Date;

public class ShopOrder implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1498416281602736411L;
	private int order_id;//订单号
	private Date buy_date;//下单日期
	private double price;//金额
	private int count;//购买数量
	private String status;//订单状态（等待付款，等待收货，已完成，已取消）
	private int user_id;//收货人ID
	private int address_id;//地址ID
	private int goods_id;//商品id
	private int payId;//支付方式id
	
	
	
	public ShopOrder() {
		super();
	}
	public ShopOrder(int order_id, Date buy_date, double price, int count, String status, int user_id, int address_id,
			int goods_id, int payId) {
		super();
		this.order_id = order_id;
		this.buy_date = buy_date;
		this.price = price;
		this.count = count;
		this.status = status;
		this.user_id = user_id;
		this.address_id = address_id;
		this.goods_id = goods_id;
		this.payId = payId;
	}
	public int getOrder_id() {
		return order_id;
	}
	public void setOrder_id(int order_id) {
		this.order_id = order_id;
	}
	public Date getBuy_date() {
		return buy_date;
	}
	public void setBuy_date(Date buy_date) {
		this.buy_date = buy_date;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public int getUser_id() {
		return user_id;
	}
	public void setUser_id(int user_id) {
		this.user_id = user_id;
	}
	public int getAddress_id() {
		return address_id;
	}
	public void setAddress_id(int address_id) {
		this.address_id = address_id;
	}
	public int getGoods_id() {
		return goods_id;
	}
	public void setGoods_id(int goods_id) {
		this.goods_id = goods_id;
	}
	public int getPayId() {
		return payId;
	}
	public void setPayId(int payId) {
		this.payId = payId;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + address_id;
		result = prime * result + ((buy_date == null) ? 0 : buy_date.hashCode());
		result = prime * result + count;
		result = prime * result + goods_id;
		result = prime * result + order_id;
		result = prime * result + payId;
		long temp;
		temp = Double.doubleToLongBits(price);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		result = prime * result + user_id;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ShopOrder other = (ShopOrder) obj;
		if (address_id != other.address_id)
			return false;
		if (buy_date == null) {
			if (other.buy_date != null)
				return false;
		} else if (!buy_date.equals(other.buy_date))
			return false;
		if (count != other.count)
			return false;
		if (goods_id != other.goods_id)
			return false;
		if (order_id != other.order_id)
			return false;
		if (payId != other.payId)
			return false;
		if (Double.doubleToLongBits(price) != Double.doubleToLongBits(other.price))
			return false;
		if (status == null) {
			if (other.status != null)
				return false;
		} else if (!status.equals(other.status))
			return false;
		if (user_id != other.user_id)
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "ShopOrder [order_id=" + order_id + ", buy_date=" + buy_date + ", price=" + price + ", count=" + count
				+ ", status=" + status + ", user_id=" + user_id + ", address_id=" + address_id + ", goods_id="
				+ goods_id + ", payId=" + payId + "]";
	}
	
	
}
